import request from '@/utils/request';
import { getCookie } from '@/utils/authority';

export async function queryESIndexList(params) {
  return request('/api/indexList', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}
export async function removeESIndex(params) {
  return request('/api/indexRemove', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}

export async function backUpESIndex(params) {
  return request('/api/indexBackup', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}

export async function queryESIndexDetail(params) {
  return request('/api/indexDetail', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}
export async function sysnESIndex(params) {
  return request('/api/indexSync', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}

export async function queryESIndexFilter(params) {
  return request('/api/hive/indexPageList', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}

export async function operESStatus(params) {
  return request('/api/indexOperESStatus', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}

export async function delBatchES(params) {
  return request('/api/indexDelBatchES', {
    method: 'POST',
    headers: {
      'login-token': getCookie('tks'),
    },
    data: { ...params },
  });
}
